package com.fph.design.pay.channel;

import com.fph.design.pay.mode.IPayMode;

import java.math.BigDecimal;

/**
 * 微信⽀付
 * @ClassName WxPay
 * @Description TODO
 * @Author fph
 * @Date 2024-08-06 15:51
 **/
public class WxPay extends Pay {

    public WxPay(IPayMode payMode) {
        super(payMode);
    }


    @Override
    public String transfer(String uId, String tradeId, BigDecimal amount) {
        logger.info("模拟微信渠道⽀付划账开始。uId：{} tradeId：{} amount：{}", uId, tradeId, amount);
        boolean security = payMode.security(uId);
        logger.info("模拟微信渠道⽀付⻛控校验。uId：{} tradeId：{} security：{}", uId, tradeId, security);
        if (!security) {
            logger.info("模拟微信渠道⽀付划账拦截。uId：{} tradeId：{} amount：{}", uId, tradeId, amount);
            return "0001";
        }
        logger.info("模拟微信渠道⽀付划账成功。uId：{} tradeId：{} amount：{}", uId, tradeId, amount);
        return "0000";
    }
}

